package com.jjc.android.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.jjc.android.R
import com.jjc.android.entity.HealthRecordDto
import com.jjc.android.util.Common.parseEmpty

class HealthRecordAdapter : BaseQuickAdapter<HealthRecordDto,BaseViewHolder>(R.layout.item_health_record) {

    override fun convert(helper: BaseViewHolder, item: HealthRecordDto) {
        helper.addOnClickListener(R.id.detailTxt,R.id.right_view,R.id.drag_item)
        helper.setText(R.id.productNameTxt,item.minorTermName)
        helper.setText(R.id.resultTxt,String.format("%s: %s",mContext.getString(R.string.result_txt),item.primaryResDisplay.parseEmpty(mContext.getString(R.string.no_temp_txt))))
        helper.setText(R.id.timeTxt,String.format("%s%s",item.collectDate.parseEmpty(),mContext.getString(R.string.generate_txt)))
    }

}